<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function rightchange(char, n) {
            var arr = char.split("")
            for (var i = 1; i <= n; i++) {
                var new_arr = arr.unshift(arr.pop())
            }
            console.log(arr.join(""));
        }
        
        rightchange("abcdefg", 2)
    </script>
</head>

<body>

</body>

</html>